#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string s[] = { "one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty","a","both","another","first","second","third" };
int num[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,1,2,1,1,2,3 };
string str;
int k;
int ans[10];
int main()
{
	for (int i = 0; i < 6; i++)
	{
		cin >> str;
		for (int j = 0; j < 26; j++)
		{
			if (str == s[j])
			{
				ans[k] = num[j] * num[j] % 100;
				k++;
			}
		}
	}
	sort(ans, ans + k);
	if (k == 0)
	{
		cout << 0 << endl;
	}
	else
	{
		for (int i = 0; i < k; i++)
		{
			if (i != 0 && ans[i] < 10)  
				cout << 0;
			cout << ans[i];
		}
	}
	return 0;
}